import request from '@/utils/request'

// 查询详细地区列表
export function listRegion(query) {
  return request({
    url: '/logistics/region/list',
    method: 'get',
    params: query
  })
}

export function listRegionCenter(level) {
  return request({
    url: '/logistics/region/listCenter/'+level,
    method: 'get',
    params: level
  })
}

// 查询详细地区详细
export function getRegion(id) {
  return request({
    url: '/logistics/region/' + id,
    method: 'get'
  })
}

// 查询详细地区详细
export function getExplicitRegion(id) {
  return request({
    url: '/logistics/region/Explicit/' + id,
    method: 'get'
  })
}

// 查询详细地区详细
export function getRegionParentCodeById(id) {
  return request({
    url: '/logistics/region/parentCode/' + id,
    method: 'get'
  })
}

// 新增详细地区
export function addRegion(data) {
  return request({
    url: '/logistics/region',
    method: 'post',
    data: data
  })
}

// 修改详细地区
export function updateRegion(data) {
  return request({
    url: '/logistics/region',
    method: 'put',
    data: data
  })
}

// 删除详细地区
export function delRegion(id) {
  return request({
    url: '/logistics/region/' + id,
    method: 'delete'
  })
}
